<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>报修记录</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, user-scalable=no">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
		<meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
		<meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no"/>
		<link href="${s.base}/mobile/css/weui.min.css" rel="stylesheet"/>
		<link href="${s.base}/mobile/css/jquery-weui.css" rel="stylesheet">
		<link rel="stylesheet" href="${s.base}/mobile/css/wbNew.css" />
		<link href="${s.base}/mobile/css/weChat.css" rel="stylesheet" />
		<script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
	</head>
	<body>
		<div class="main-content75 " style="background:#f4f4f4;" id="mytask">
			<div class="my-task-menu">
				<div class="leftbtn" onclick="history.back()"><i class="cyfont">&#xe6d5;</i></div>
				<ul id="showTab">
					<li id="tab0" onclick="showRepair(0)" class="checked">全部</li>
					<li id="tab1" onclick="showRepair(1)">待分配</li>
					<li id="tab2" onclick="showRepair(2)">待维修</li>
					<li id="tab4" onclick="showRepair(4)">待确认</li>
					<li id="tab5" onclick="showRepair(5)">已完成</li>
				</ul>
			</div>
			<div id="showView">

			</div>

			<div class="nodate-ctn" style="display: none">
				<p>
					<img src="${s.base}/mobile/images/nodates.png"><br>
					<span>暂无数据</span>
				</p>
			</div>
		</div>
	</body>
	<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
	<script src="${s.base}/mobile/js/jquery-weui.js"></script>
	<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
	 <script>
         var pageSize=10;
         var pageNum=0;
         var status=${status};
         $(document).ready(function () {
             showRepair(status);
         });
         function repairDetail(id) {
			 window.location.href="/phone/wb/repairDetail?token=${token}&applyId=${applyId}&id="+id;
         }
		 function showRepair(status) {
             $('.nodate-ctn').hide();
             $("#showView").html("");
		     $("#showTab li").removeClass("checked");
             $("#tab"+status).addClass("checked");
			 if(status==0){
			     status="";
			 }
             $.fn.doPost('/phone/wb/myRepair',{pageNum: pageNum, pageSize: pageSize,wbUserId:'${wbUser.id}',applyId:'${applyId}',status:status}, function (result) {
                 var content = "";
                 if (result.code === 0) {
                     for (var i = 0; i < result.data.length; i++) {
                         var items = result.data[i];
                         content +='<div onclick="repairDetail(\''+items.id+'\')" class="cont-block marb20">'+
                             '<div class="my-task-tit">'+
                             '<div class="my-task-tit-name">'+items.deviceName+'</div>';
                         if (items.status == "4") {
                             content += '<div class="my-task-tit-type">待确认</div>';
                         } else  if (items.status == "2") {
                             content += '<div class="my-task-tit-type">待维修</div>';
                         } else  if (items.status == "3") {
                             content += '<div class="my-task-tit-type">已返修</div>';
                         } else  if (items.status == "5") {
                             content += '<div class="my-task-tit-type">已维修</div>';
                         } else {
                             content += '<div class="my-task-tit-type">待分配</div>';
                         }
                        content +='</div>'+
                             '<div class="my-task-txt">'+
                             '<div class="my-task-txt-pic" style="background:url(/mobile/images/news.png);"></div>'+
                             '<div class="div-line-txt">报修类型：<span>';
                         if (items.repairType == "3") {
                             content += '扫码报修';
                         } else  if (items.repairType == "2") {
                             content += '扫码报修';
                         } else {
                             content += '简易报修';
                         }
                         content +='</span></div>'+
                             '<div class="div-line-txt">报修时间：<span>'+new Date(items.createTime).Format("yyyy-MM-dd hh:mm")+'</span></div>'+
                             '</div></div>';
                     }
                     if (isBlank(content)) {
                         $('.nodate-ctn').show();
                     }else {
                         $("#showView").html(content);
                     }

                 } else {
                     $.toast(result.msg, "text");
                 }

             });
         }
	  </script>
</html>
